//新品上市tab转换
var timer_recommend = null;
var timer_recommend_change = window
		.setInterval("recommendTabAutoChange()", 500);
var recommend_id = 0;
var recommend_total = 3;
var recommend_times = 0;
var recommend_position = 0;

function recommendTabChange() {
	var tmp_target_position = -recommend_id * 300;
	if (recommend_position != tmp_target_position) {
		var sign = (tmp_target_position > recommend_position) ? 1 : -1;
		recommend_position += sign * 60;
		document.getElementById('recommend_img_container').style.cssText = "margin-top: "
				+ recommend_position + "px;";
	} else {
		window.clearInterval(timer_recommend);
		timer_recommend = null;
	}
}

function recommendTabAutoChange() {
	recommend_times++;
	if (recommend_times > 10) {
		recommend_times = 0;
		var tmp_id = recommend_id + 1;
		if (tmp_id == recommend_total) {
			tmp_id = 0;
		}
		setrecommendTab(tmp_id);
	}
}

function setrecommendTab(id) {
	if (recommend_id != id) {
		recommend_id = id;
		recommend_times = 0;
		var treeNode = document.getElementById("recommend_tab_ul");
		for ( var i = 0; i < treeNode.childNodes.length; i++) {
			var obj = treeNode.childNodes[i];
			obj.className = "";
		}
		// ev.className = "current";
		document.getElementById('recommend_tab_li_' + id).className = "current";
		if (timer_recommend == null) {
			timer_recommend = window.setInterval("recommendTabChange()", 30);
		}
	}
}

